/*
 * @Description: 获取url中的参数
 * @Autor: lcz
 * @Date: 2022-08-19 16:55:59
 * @LastEditors: lcz
 * @LastEditTime: 2022-08-19 16:57:54
 */

type exportPoprs = null | string

export function getQueryString(name: string): exportPoprs {
  let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  let r = (window as any).location.search.substr(1).match(reg);
  if (r != null) {
    return unescape(r[2]);
  }
  return null;
}